package cn.stylefeng.guns.modular.yingbao.controller;

import cn.stylefeng.guns.modular.yingbao.entity.SysGroupLog;
import cn.stylefeng.guns.modular.yingbao.service.SysGroupLogService;
import cn.stylefeng.guns.rabbitmq.producer.Sender;
import cn.stylefeng.guns.rabbitmq.vo.MessageVo;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author jj
 * @date 2019/12/9 15:45
 */
@RestController
@RequestMapping("test")
public class TsetController {
    @Autowired
    SysGroupLogService sysGroupLogService;


    @RequestMapping("sender" )
    @Transactional(rollbackFor = Exception.class)
    public String set() {
        SysGroupLog byId = sysGroupLogService.getById ( 1 );
        byId.setBuildId ( "你好" );
        boolean id = sysGroupLogService.update ( byId, new QueryWrapper<SysGroupLog> ().eq ( "id", byId.getId () ) );
        SysGroupLog byId1 = sysGroupLogService.getById ( 1 );
        byId.setBuildId ( "你好1" );
        boolean id1 = sysGroupLogService.update ( byId, new QueryWrapper<SysGroupLog> ().eq ( "id", byId.getId () ) );
        return "成功";
    }
}
